package cn.com.roy.thread.t4_1_1.reentrantlocktest;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class MyService {
    private Lock lock = new ReentrantLock();
    public void testMethod(){
        lock.lock();
        for (int i = 0; i < 5; i++) {
            System.out.println("" + Thread.currentThread().getName() + " " + (i+1));
        }
        lock.unlock();
    }
}
